<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小技巧</title>
    <style>
        * {
            box-sizing: border-box;
        }
        .clearfix::after {
            content: '';
            display: block;
            clear: both;
        }
        .wrapper>div {
            float: left;
            margin-right: 200px;
            width: 100px;
            height: 100px;
            background-color: grey;
            text-align: center;
        }
        .parallelogram1 {
            transform: skewX(-30deg);
        }
        .parallelogram2 {
            transform: skewX(-30deg);
        }
        .parallelogram2-inner {
            transform: skewX(30deg);
        }
        .parallelogram3 {
            position: relative;
            background: transparent !important;
        }
        .parallelogram3::after {
            z-index: -1;
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            background-color: grey;
            transform: skewX(-30deg);
        }
        .trapezoid1 {
            transform: perspective(100px) rotateX(45deg);
            transform-origin: bottom;
        }
        .trapezoid2 {
            transform: perspective(100px) rotateX(45deg);
            transform-origin: bottom;
        }
        .trapezoid2-inner {
            transform: perspective(-100px) rotateX(-45deg);
            transform-origin: bottom;
        }
        .trapezoid3 {
            position: relative;
            background: transparent !important;
            line-height: 100px;
        }
        .trapezoid3::after {
            z-index: -1;
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            background-color: grey;
            transform: scaleY(1.3) perspective(150px) rotateX(45deg);
            transform-origin: bottom;
        }

    </style>
</head>
<body>
    <div class="wrapper clearfix">
        <div class="parallelogram1">平行四边形1</div>
        <div class="parallelogram2">
            <div class="parallelogram2-inner">平行四边形2</div>
        </div>
        <div class="parallelogram3">平行四边形3</div>
        <div class="trapezoid1">梯形1</div>
        <div class="trapezoid2">
            <div class="trapezoid2-inner">
                梯形2
            </div>
        </div>
        <div class="trapezoid3">梯形3</div>
    </div>
</body>
</html>